package com.forte.orderservice;

import java.util.Date;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import com.forte.orderdao.Order;
import com.forte.orderdao.OrderDAO;
import com.forte.orderdao.OrderDetails;

public class OrderServiceImpl implements OrderService{
	
	@Autowired
	private OrderDAO orderDao;
	
	public void setOrderDAO(OrderDAO orderDao){
		this.orderDao = orderDao;
	}

	public void saveOrUpdate(Order order) {
		orderDao.saveOrUpdate(order);		
	}

	public void saveOrUpdate(OrderDetails orderDetails) {
		orderDao.saveOrUpdate(orderDetails);		
	}

	public Order findOrderByOrderId(String orderId) {
		return orderDao.findOrderByOrderId(orderId);
	}

	public List<Order> findOrderByOrderDate(Date orderDate) {
		return orderDao.findOrderByOrderDate(orderDate);
	}

	public List<Order> findOrderByStatus(String status) {
		return orderDao.findOrderByStatus(status);
	}

	public List<Order> findOrderByDeliveryId(int deliveryId) {
		return orderDao.findOrderByDeliveryId(deliveryId);
	}

	public OrderDetails findOrderDetailsByOrderId(String orderId) {
		return orderDao.findOrderDetailsByOrderId(orderId);
	}
}
